<template>
  <div class="box">
    <!-- 概况start -->
    <el-row>
      <el-col :span="24">
        <div class="grid-content bg-purple-dark" style="height: 170px">
          <div class="box_text">
            行政概况
            <span class="box_text2">更新时间：2035年6月19日 12:35:59</span>
          </div>
          <el-row>
            <!-- 资产数量 -->
            <div
              class="box_1"
              style="background-color: #1890ff; border-radius: 10px"
            >
              <div class="box_1_img">
                <i
                  class="iconfont icon-jinbi"
                  style="font-size: 50px; color: #95deee"
                ></i>
              </div>
              <div class="text_1">
                <span class="text_2_span">资产数量</span>
                <span class="text_1_color"
                  ><span class="text_1_span">7654</span></span
                ><br />
              </div>
            </div>
            <!-- 资产总价值 -->
            <div
              class="box_1"
              style="background-color: #ff8e8e; border-radius: 10px"
            >
              <div class="box_1_img">
                <i
                  class="iconfont icon-dingdan"
                  style="font-size: 50px; color: #ffcdcd"
                ></i>
              </div>
              <div class="text_1">
                <span class="text_2_span">资产总价值</span>
                <span class="text_1_color"
                  ><span class="text_1_span">6988</span></span
                ><br />
              </div>
            </div>
            <!-- 应收账款 -->
            <div
              class="box_1"
              style="background-color: #8e7bfc; border-radius: 10px"
            >
              <div class="box_1_img">
                <i
                  class="iconfont icon-lirun2"
                  style="font-size: 50px; color: #cdc5fe"
                ></i>
              </div>
              <div class="text_1">
                <span class="text_2_span">应收账款</span>
                <span class="text_1_color"
                  ><span class="text_1_span">548</span></span
                ><br />
              </div>
            </div>
            <!-- 应付账款 -->
            <div
              class="box_1"
              style="background-color: #ffb700; border-radius: 10px"
            >
              <div class="box_1_img">
                <i
                  class="iconfont icon-chezaikucun"
                  style="font-size: 40px; color: #ffdf8f"
                ></i>
              </div>
              <div class="text_1">
                <span class="text_2_span">应付账款</span>
                <span class="text_1_color"
                  ><span class="text_1_span">26937</span></span
                ><br />
              </div>
            </div>
            <!-- 账户余额 -->
            <div
              class="box_1"
              style="background-color: #92dd8b; border-radius: 10px"
            >
              <div class="box_1_img">
                <i
                  class="iconfont icon-userplus-fill"
                  style="font-size: 45px; color: #cff0cc"
                ></i>
              </div>
              <div class="text_1">
                <span class="text_2_span">账户余额</span>
                <span class="text_1_color"
                  ><span class="text_1_span">8698</span></span
                ><br />
              </div>
            </div>
            <!-- 在职员工数 -->
            <div
              class="box_1"
              style="background-color: #5dcce5; border-radius: 10px"
            >
              <div class="box_1_img">
                <i
                  class="iconfont icon-jinbi1"
                  style="font-size: 45px; color: #b8e9f4"
                ></i>
              </div>
              <div class="text_1">
                <span class="text_2_span">在职员工数</span>
                <span class="text_1_color"
                  ><span class="text_1_span">7383</span></span
                ><br />
              </div>
            </div>
          </el-row>
        </div>
      </el-col>
    </el-row>
    <!-- 概况end -->
    <el-row :gutter="10">
      <!-- 账户余额start -->
      <el-col :span="9">
        <div class="grid-content bg-purple-dark" style="height: 300px">
          <div>&nbsp;</div>
          <div id="myChart" :style="{ width: '500px', height: '300px' }"></div>
        </div>
      </el-col>
      <!-- 账户余额end -->
      <!-- 账户收入start -->
      <el-col :span="9">
        <div class="grid-content bg-purple-dark" style="height: 300px">
          <div>&nbsp;</div>
          <div id="myChart2" :style="{ width: '500px', height: '300px' }"></div>
        </div>
      </el-col>
      <!-- 账户收入end -->
    </el-row>
    <!-- 资产总价值start -->
    <el-row :gutter="10">
      <el-col :span="18">
        <div class="grid-content bg-purple-dark" style="height: 300px">
          <div>&nbsp;</div>
          <div
            id="myChart3"
            :style="{ width: '1000px', height: '300px' }"
          ></div>
        </div>
      </el-col>
    </el-row>
    <!-- 资产总价值end -->
    <!-- 在职员工数start -->
    <el-row :gutter="10">
      <el-col :span="18">
        <div class="grid-content bg-purple-dark" style="height: 300px">
          <div>&nbsp;</div>
          <div
            id="myChart4"
            :style="{ width: '1000px', height: '300px' }"
          ></div>
        </div>
      </el-col>
    </el-row>
    <!-- 在职员工数end -->
    <!-- 公告start -->
    <div class="notice">
      <div class="box_text">
        公告<span style="float: right; font-size: 12px; margin-right: 20px"
          >查看更多 ></span
        >
      </div>
      <!-- 公告信息 绿标 -->
      <div class="notice_message">
        <div class="tag">
          <el-tag type="success"  size="mini">信息</el-tag>
        </div>
        <div class="message">
          <span>系统新版本升级通知，新功能介绍</span>
        </div>
      </div>
      <!-- 公告信息 红标 -->
      <div class="notice_message">
        <div class="tag">
          <el-tag type="danger"  size="mini">信息</el-tag>
        </div>
        <div class="message">
          <span>系统新版本升级通知，新功能介绍</span>
        </div>
      </div>
    </div>
    <!-- 公告end -->
    <!-- 本月业绩完成度start -->
    <div class="notice2">
        <div class="box_text">本月业绩完成度</div>
      <div style="margin-left: 10px">
        <div
          id="myChart5"
          :style="{ width: '300px', height: '210px' }"
          style="margin-top: 20px"
        ></div>
      </div>
    </div>
    <!-- 本月业绩完成度end -->
  </div>
</template>

<script>
export default {
  name: "GeneralManagerworkbench",
  data() {
    return {};
  },
  created() {},
  mounted() {
    //账户余额
    this.AccountbalanceChart();
    //项目收入
    this.AccountincomeChart();
    //资产总价值
    this.TotalvalueofassetsChart();
    //在职员工数
    this.NumberofactiveemployeesChart();
    // 本月业绩完成度
    this.completenessChart();
  },
  methods: {
    // 账户余额图表
    AccountbalanceChart() {
      let echarts = require("echarts");
      let myChart = echarts.init(document.getElementById("myChart"));
      var option = {
        title: {
          text: "       账户余额",
        },
        xAxis: {
          type: "value",
        },
        yAxis: {
          type: "category",
          data: ["账户C", "账户B", "账户A"],
        },
        series: [
          {
            data: [120, 200, 150, 80, 70, 110, 130],
            type: "bar",
          },
        ],
      };
      myChart.setOption(option); // 渲染页面
      //随着屏幕大小调节图表
      window.addEventListener("resize", () => {
        myChart.resize();
      });
    },
    // 账户收入
    AccountincomeChart() {
      let echarts = require("echarts");
      let myChart = echarts.init(document.getElementById("myChart2"));
      var option = {
        title: {
          text: "       项目收入",
        },
        color: ["#fb7b13"],
        xAxis: {
          type: "value",
        },
        yAxis: {
          type: "category",
          data: ["项目C", "项目B", "项目A"],
        },
        series: [
          {
            data: [120, 200, 150, 80, 70, 110, 130],
            type: "bar",
            label: {
              show: true, //开启显示
              position: "right", //在上方显示
              formatter: "{c}", //显示百分号
              textStyle: {
                //数值样式
                color: "black", //字体颜色
                fontSize: 10, //字体大小
              },
            },
          },
        ],
      };
      myChart.setOption(option); // 渲染页面
      //随着屏幕大小调节图表
      window.addEventListener("resize", () => {
        myChart.resize();
      });
    },
    // 资产总价值
    TotalvalueofassetsChart() {
      let echarts = require("echarts");
      let myChart = echarts.init(document.getElementById("myChart3"));
      var option = {
        title: {
          text: "            资产总价值",
        },
        legend: {
          data: ["资产总价值"],
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "cross",
            label: {
              backgroundColor: "#6a7985",
            },
          },
        },
        xAxis: {
          type: "category",
          data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            name: "资产总价值",
            data: [150, 230, 224, 218, 135, 147, 50],
            type: "line",
          },
        ],
      };
      myChart.setOption(option); // 渲染页面
      //随着屏幕大小调节图表
      window.addEventListener("resize", () => {
        myChart.resize();
      });
    },
    // 在职员工数
    NumberofactiveemployeesChart() {
      let echarts = require("echarts");
      let myChart = echarts.init(document.getElementById("myChart4"));
      var option = {
        title: {
          text: "            在职员工数",
        },
        legend: {
          data: ["在职员工数"],
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "cross",
            label: {
              backgroundColor: "#6a7985",
            },
          },
        },
        xAxis: {
          type: "category",
          data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            name: "在职员工数",
            data: [150, 230, 224, 218, 135, 147, 50],
            type: "line",
          },
        ],
      };
      myChart.setOption(option); // 渲染页面
      //随着屏幕大小调节图表
      window.addEventListener("resize", () => {
        myChart.resize();
      });
    },
    // 本月业绩完成度
    completenessChart() {
      let echarts = require("echarts");
      let myChart = echarts.init(document.getElementById("myChart5"));
      var option = {
        title: {
          text: "80%",
          x: "center",
          y: "center",
          textStyle: {
            fontWeight: "normal",
            color: "#0580f2",
            fontSize: "20",
          },
          subtext: "完成度",
          subtextStyle: {
            fontSize: 18,
          },
        },
        color: ["#e9edfc"],

        series: [
          {
            name: "Line 1",
            type: "pie",
            clockWise: true,
            radius: ["50%", "66%"],
            itemStyle: {
              normal: {
                label: {
                  show: false,
                },
                labelLine: {
                  show: false,
                },
              },
            },
            hoverAnimation: false,
            data: [
              {
                value: 80,
                name: "01",
                itemStyle: {
                  normal: {
                    color: "#f7c32b",
                    label: {
                      show: false,
                    },
                    labelLine: {
                      show: false,
                    },
                  },
                },
              },
              {
                name: "02",
                value: 20,
              },
            ],
          },
        ],
      };

      myChart.setOption(option); // 渲染页面
      //随着屏幕大小调节图表
      window.addEventListener("resize", () => {
        myChart.resize();
      });
    },
  },
};
</script>

<style scoped>
/* element-ui样式 */
.el-row {
  margin-bottom: 10px;
  &:last-child {
    margin-bottom: 0;
  }
}
.el-col {
  border-radius: 4px;
}
.bg-purple-dark {
  background: #fff;
  border-radius: 10px;
}
/* 自定义样式 */
* {
  margin: 0px;
  padding: 0px;
}
.box {
  width: 98%;
  height: 100%;
  margin: auto;
  /* background-color: red; */
}
.box_text {
  padding-top: 20px;
  padding-left: 40px;
  font-size: 14px;
}
.box_text2 {
  padding-left: 20px;
  font-size: 14px;
  color: #989daa;
}
.box_1 {
  width: 180px;
  height: 78px;
  margin-left: 25px;
  margin-top: 20px;
  float: left;
  /* padding-left: 40px; */
}
.text_1 {
  margin-top: 10px;
  margin-left: 10px;
  width: 85px;
  float: left;
  color: #fff;
}
.text_1_span {
  margin-top: 20px;
  font-size: 23px;
}
.text_2_span {
  font-size: 12px;
}
.box_1_img {
  float: left;
  margin-top: 10px;
  margin-left: 20px;
}
/* 公告 */
.notice {
  width: 300px;
  height: 280px;
  position: relative;
  left: 960px;
  top: -930px;
  border-radius: 10px;
  margin-top: 10px;
  background-color: #fff;
}
.notice_message {
  float: left;
  width: 250px;
  height: 20px;
  margin-left: 30px;
  margin-top: 12px;
  border-radius: 5px;
  /* border: 1px solid red; */
}
.notice_message:hover {
  background-color: #b7b6b6;
}
.tag {
  float: left;
}
.message {
  float: left;
  margin-left: 20px;
  line-height: 22px;
  font-size: 12px;
}
/* 资产分布 */
.notice2 {
  width: 300px;
  height: 408px;
  position: relative;
  left: 960px;
  top: -930px;
  border-radius: 10px;
  margin-top: 10px;
  background-color: #fff;
}
</style>